<?php
Database($_SESSION['cid']);
header("content-type:text/html;charset=utf-8");
class SupplydemandAction extends Action{
	public function index(){
		$rs = pageing('supplydemand_type',5,'',$_GET['seach'],'type_id desc','type_id','type_name','',"DB_MEETING");
		
		$this ->assign("rs" , $rs);
		$this ->display();
	}

	public function addAct(){

		$rs=D('Supplydemand')->add_supplydemand($_POST);
		if($rs){
			$this->success("添加成功!",__URL__);
		} else {
			$this->error("添加失败!");
		}
	}

	public function delAct(){
		$rs = D('Supplydemand')->del_act($_GET);
		if($rs){
			$this->success("删除成功!",__URL__);
		} else {
			$this->error("删除失败!");
		}
	}
	public function to_update(){
		$rs = M('supplydemand_type' , '' , 'DB_MEETING')->where('type_id='.$_GET['type_id'])->find();
		$this ->assign("rs" , $rs);
		$this ->display();
	}

	public function uptAct(){
		$rs = D('Supplydemand')->upt($_POST);
		if($rs){
			$this->success("修改成功!",__URL__);
		} else {
			$this->error("修改失败!");
		}
	}
}

?>